unsigned int program::parse_ConditionIf(unsigned int i)
{
   char ifchar('['); // used to control whether the parser stops moving at beginning or end of block; defaults to beginning
   
   // if statement
   i ++; // move onto argument
   if ( at(i) == '_' )
   {
      i ++; // examine condition
      switch ( at(i) )
      {
         case '0':
            ifchar = ']';
            break;
         case '1':
            ifchar = '[';
            i ++;
            break;
         case '"':
            i ++;
            while ( at(i) != '\"' )
            {
               tempname.push_back(at(i));
               i ++;
            }
            if ( nameExists(tempname) )
            {
               datatype = nameType(tempname);
               switch (datatype)
               {
                  case 0:
                     if ( !ints[nameSearch(tempname)] ) { ifchar = ']'; }
                     else { ifchar = '['; }
                     break;
                  case 1:
                     if ( !chars[nameSearch(tempname)] ) { ifchar = ']'; }
                     else { ifchar = '['; }
                     break;
               }
            }
            else { ErrorInvalidName(i, tempname); }
            break;
         case '=':
            i += 2; // move onto next argument
            if ( at(i) == '\"' )
            {
               i++; // move into name;
               while ( at(i) != '\"' )
               {
                  tempname.push_back(at(i));
                  i ++;
               }
               
               if ( nameExists(tempname) )
               {
                  datatype = nameType(tempname);
                  i ++; // move into next identifier
                  if ( at(i) == '\"' )
                  {
                     i ++;
                     while ( at(i) != '\"' )
                     {
                        tempname0.push_back(at(i));
                        i ++;
                     }
                     
                     if ( nameExists(tempname0) )
                     {
                        switch (datatype)
                        {
                           case 0:
                              if ( ints[nameSearch(tempname)] == ints[nameSearch(tempname0)] ) { ifchar = '['; }
                              else { ifchar = ']'; }
                              break;
                           case 1:
                              if ( chars[nameSearch(tempname)] == chars[nameSearch(tempname0)] ) { ifchar = '['; }
                              else { ifchar = ']'; }
                              break;
                        }
                     }
                     else { ErrorInvalidName(i,tempname0); }
                  }
                  else if ( at(i) == '\'' )
                  {
                     i ++;
                     switch (datatype)
                     {
                        case 0:
                           // INT DAMMIT
                           break;
                        case 1:
                           if ( at(i) == chars[nameSearch(tempname)] ) { ifchar = '['; }
                           else { ifchar = ']'; }
                           break;
                     }
                  }
                  else { ErrorWrongArgument (i, 'I'); }
               }
               else { ErrorInvalidName(i, tempname); }
            }
            else { ErrorWrongArgument(i, 'I'); }
            break;
         default:
            ErrorInvalidCondition(i,at(i));
      }
      while ( at(i) != ifchar )
      {
         i ++;
      }
   }
   else { ErrorWrongArgument(i,'I'); }
   return i;
}
